feat: Allow files in wheels to be installed to directories#3233
feat: Allow files in wheels to be installed to directories#3233rickeylev merged 5 commits intobazel-contrib:mainfrom
Conversation
6477498 to
c9f1b27
Compare
|
Sorry for the long pause while this sat here, been a busy few months but I got some time to come back to this. Still need to add a few tests + update docs, but the core functionality is ready. |
|
@aignas Can I get a review on this? We've been using it internally for a while and it's working well for us. Happy to add tests/docs, etc. if you'd like. |
aignas
left a comment
There was a problem hiding this comment.
Thank you for the patch, could you please add an example in the wheel examples folder please? Then a changelog note advertising the functionality and updating the docstring of the affected py_wheel. :)
|
Yup, sure thing! |
When specifying `data_files` in `py_wheel`, allow just the directory to be specified (with a trailing slash), in which case it will use the file's name. This avoids duplicating (potentially platform-specific) names.
f5faa54 to
ecdd24d
Compare
ecdd24d to
9858340
Compare
|
Done, done, and done! |
rickeylev
left a comment
There was a problem hiding this comment.
Looks like Ignas's comments have been address, so approving and enqueuing
|
Huh, failures look unrelated to my changes (as far as I can tell, happy to be told otherwise). What's the policy when this happens? |
|
Bazel ci and/or GitHub has been flaky with network reliability lately, so we just requeue and retry |
When specifying
data_filesinpy_wheel, allow just the directory to be specified (with a trailing slash), in which case it will use the existing filename. This avoids duplicating (potentially platform-specific) names. Additionally, targets with multiple files can be installed as a group to a folder, with the same filename-preserving behavior. In general I think this is a better starting point, as I imagine most of the time users would want to preserve the names.Before, this would result in the file simply not being installed, so this only changes already-broken behavior.